import java.awt.Point;
/**
 * A Word class encapsulates word (string) and location of word (Point[]) together. It also 
 * provide functions to access and modify contents of the Word objects.  
 *  
 * The function prototypes are as listed below:
 * public void setWord (String newWord)
 * public void setLocation (Point[] newLocation)
 * public String getWord () 
 * public Point[] getLocation ()  
 * 
 * @author Hardik
 *
 */
public class Word implements Cloneable {

	private String word; 
	private Point[] location;
	
	/**
	 * 
	 */
	public Word() {
		// TODO Auto-generated constructor stub
		word = null; 
		location = null;
	}
	
	/**
	 * 
	 * @param initialWord
	 */
	public Word(String initialWord) {
		// TODO Auto-generated constructor stub  
		word = initialWord; 
		location = null;
	}
	
	/**
	 * 
	 * @param initialWord
	 * @param initialLocation
	 */
	public Word(String initialWord, Point[] initialLocation) {
		// TODO Auto-generated constructor stub  
		word = initialWord; 
		location = initialLocation;
	}
	
	/**
	 * set or insert the word into object
	 * 
	 * @param newWord to set word object to  
	 */
	public void setWord (String newWord) { 
		word = newWord; 
	}
	
	/**
	 * set the location of the word that Word object contian
	 * 
	 * @param newLocation of the word to set 
	 */
	public void setLocation (Point[] newLocation) { 
		location = newLocation;  
	}
	
	/**
	 * gives String word that Word object contain 
	 * 
	 * @return word that Word object contain as String  
	 */
	public String getWord () { 
		return(word);  
	}
	
	/**
	 * gives location of String word that Word object contain in 
	 * array of point format 
	 * 
	 * @return location of word that Word object contain  
	 */
	public Point[] getLocation () { 
		return(location);  
	}
	
	public Word clone(){
		
		Word w = null;
		try {
			w = (Word)super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return w;
		
	}
}
